cmake_minimum_required(VERSION 3.4.1)
project(OpenCLDemo)

set(CMAKE_C_STANDARD 99)
set(CMAKE_CXX_STANDARD 14)

set(opencl_inc "")
set(opencl_src "")
set(opengl_lib "")

file(GLOB_RECURSE tmp "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp")
list(APPEND opencl_src ${tmp})
list(APPEND opencl_inc ${CMAKE_CURRENT_SOURCE_DIR}/src)

list(APPEND opencl_inc ${CMAKE_CURRENT_SOURCE_DIR}/open_source/opencl/OpenCL-CLHPP-v2.0.12/include)
list(APPEND opencl_inc ${CMAKE_CURRENT_SOURCE_DIR}/open_source/opencl/OpenCL-Headers-v2020.12.18/)

list(APPEND opencl_inc ${CMAKE_CURRENT_SOURCE_DIR})

list(APPEND opengl_lib GLESv3 EGL)

include_directories(${opencl_inc})

add_library(OpenCLDemoLib SHARED ${opencl_src})
target_link_libraries(OpenCLDemoLib ${opengl_lib})
target_compile_definitions(OpenCLDemoLib
PRIVATE
    USE_OPENCL_WRAPPER
    CL_HPP_TARGET_OPENCL_VERSION=200
)


add_executable(OpenCLDemo ${CMAKE_CURRENT_SOURCE_DIR}/test.cpp)
target_link_libraries(OpenCLDemo OpenCLDemoLib)

target_compile_definitions(OpenCLDemo
PRIVATE
    USE_OPENCL_WRAPPER
    CL_HPP_TARGET_OPENCL_VERSION=200
)

